<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use \Illuminate\Support\Facades\Route;

//首页
Route::get('/', function () {
    return view('welcome');
});

//字符串路由
Route::get('hello', function () {
    return 'Hello, Welcome to LaravelAcademy.org';
});

//控制器路由
Route::get('/index', '\App\Http\Controllers\Index\IndexController@index');

//视图路由
Route::get('/websocket_client', function () {
    return view('websocket.client');
});

//Index分组路由
Route::group([ 'namespace' => 'Index' ,'prefix' => 'index'], function ($router) {
    $router->get('/user', 'IndexController@getUser');
});

//分组路由
Route::group([ 'namespace' => 'Task' ,'prefix' => 'task'], function ($router) {
    $router->get('/test', 'TestController@test');
});

//弹幕页面
Route::get('/danmu', function() {
    return view('websocket.danmu');
});

//登录
Route::get('/login', function() {
    return '登录成功';
})->name('login');

//退出登录
Route::get('/logout', function() {
    return '退出登录成功';
})->name('logout');

//注册
Route::get('/register', function() {
    return '注册成功';
})->name('register');